/**
 * @class Ext.ux.form.TimeField
 * @extends Ext.ux.form.FieldPanel
 * This class creates a time field using spinners.
 * @license: BSD
 * @author: Robert B. Williams (extjs id: vtswingkid)
 * @constructor
 * Creates a new FieldPanel
 * @param {Object} config Configuration options
 */
Ext.namespace("Ext.ux.form");
Ext.ux.form.MyTimeField = Ext.extend(Ext.ux.form.FieldPanel, {
	border: false,
	baseCls: null,
	layout: 'table',
	token: ':',
	layoutConfig: {
		columns: 3
	},
	width: 180,
	// private

	initComponent: function()
	{
		this.items = [{
			xtype:'numberfield',
			width:50,
			name: this.name + '0',
			validator:function(value){
				var b = /^[0-9]$/.test(value);
				var c = /^1[0-9]$/.test(value);
				var d = /^2[0-3]$/.test(value);
				if(!b & !c & !d){
					Ext.Msg.alert("系统提示", "请输入正确时间");
					return "请输入正确小时";
				}
				return true;
			}
		}, {
			html: ':',
			baseCls: null,
			bodyStyle: 'font-weight: bold; font-size-adjust: .9',
			border: false
		}, {
			xtype:'numberfield',
			width:50,
			name: this.name + '1',
			validator:function(value){
				var b = /^[0-9]$/.test(value);
				var c = /^[1-5][0-9]$/.test(value);
				if(!b & !c){
					Ext.Msg.alert("系统提示", "请输入正确时间");
					return "请输入正确分钟";
				}
				return true;
			}
		}]
		Ext.ux.form.MyTimeField.superclass.initComponent.call(this);
	}
});
Ext.reg('mytimefield', Ext.ux.form.MyTimeField);


Ext.ux.form.ComboTimeField = Ext.extend(Ext.ux.form.FieldPanel, {
	border: false,
	baseCls: null,
	layout: 'table',
	token: ':',
	layoutConfig: {
		columns: 3
	},
	width: 180,
	// private

	initComponent: function(){

				var store = new Ext.data.SimpleStore({
				fields: ['value'],
				data : [['0'],['1'],['2'],['3'],['4'],['5'],['6'],['7'],['8'],['9'],['10'],['11'],['12'],['13'],['14'],['15'],['16'],['17'],['18'],['19'],['20'],['21'],['22'],['23']]
				});

				var combo = new Ext.form.ComboBox({
				store: store,
				displayField:'value',
                hideLabel:true,
				hiddenName: this.name + '0',
				triggerAction: 'all',
				width:50,
				mode: 'local',
					validator:function(value){
						var b = /^[0-9]$/.test(value);
						var c = /^1[0-9]$/.test(value);
						var d = /^2[0-3]$/.test(value);
						if(!b & !c & !d){
							Ext.Msg.alert("系统提示", "请输入正确时间");
							return "请输入正确小时";
						}
						return true;
				    }
		        });
		        
		        var store1 = new Ext.data.SimpleStore({
				fields: ['value'],
				data : [['0'],['1'],['2'],['3'],['4'],['5'],['6'],['7'],['8'],['9'],['10'],['11'],['12'],['13'],['14'],['15'],['16'],['17'],['18'],['19'],['20'],
				['21'],['22'],['23'],['24'],['25'],['26'],['27'],['28'],['29'],['30'],['31'],['32'],['33'],['34'],['35'],['36'],['37'],['38'],['39'],['40'],
				['41'],['42'],['43'],['44'],['45'],['46'],['47'],['48'],['49'],['50'],['51'],['52'],['53'],['54'],['55'],['56'],['57'],['58'],['59']]
				});

				var combo1 = new Ext.form.ComboBox({
				store: store1,
				displayField:'value',
                hideLabel:true,
				hiddenName: this.name + '1',
				triggerAction: 'all',
				width:50,
				mode: 'local',
					validator:function(value){
						var b = /^[0-9]$/.test(value);
						var c = /^[1-5][0-9]$/.test(value);
						if(!b & !c){
							Ext.Msg.alert("系统提示", "请输入正确时间");
							return "请输入正确分钟";
						}
						return true;
					}
		        });
		this.items = [combo, {
			html: ':',
			baseCls: null,
			bodyStyle: 'font-weight: bold; font-size-adjust: .9',
			border: false
		},combo1 ]
		Ext.ux.form.ComboTimeField.superclass.initComponent.call(this);
	}
});
Ext.reg('combotimefield', Ext.ux.form.ComboTimeField);

Ext.ux.form.SecTimeField = Ext.extend(Ext.ux.form.FieldPanel, {
	border: false,
	baseCls: null,
	layout: 'table',
	token: ':',
	layoutConfig: {
		columns: 5
	},
	width: 180,
	// private

	initComponent: function()
	{
		this.items = [{
			xtype:'numberfield',
			width:50,
			name: this.name + '0',
			validator:function(value){
				var b = /^[0-9]$/.test(value);
				var c = /^1[0-9]$/.test(value);
				var d = /^2[0-3]$/.test(value);
				if(!b & !c & !d){
					Ext.Msg.alert("系统提示", "请输入正确时间");
					return "请输入正确小时";
				}
				return true;
			}
		}, {
			html: ':',
			baseCls: null,
			bodyStyle: 'font-weight: bold; font-size-adjust: .9',
			border: false
		}, {
			xtype:'numberfield',
			width:50,
			name: this.name + '1',
			validator:function(value){
				var b = /^[0-9]$/.test(value);
				var c = /^[1-5][0-9]$/.test(value);
				if(!b & !c){
					Ext.Msg.alert("系统提示", "请输入正确时间");
					return "请输入正确分钟";
				}
				return true;
			}
		}, {
			html: ':',
			baseCls: null,
			bodyStyle: 'font-weight: bold; font-size-adjust: .9',
			border: false
		}, {
			xtype:'numberfield',
			width:50,
			name: this.name + '2',
			validator:function(value){
				var b = /^[0-9]$/.test(value);
				var c = /^[1-5][0-9]$/.test(value);
				if(!b & !c){
					Ext.Msg.alert("系统提示", "请输入正确时间");
					return "请输入正确秒";
				}
				return true;
			}
		}]
		Ext.ux.form.SecTimeField.superclass.initComponent.call(this);
	}
});
Ext.reg('sectimefield', Ext.ux.form.SecTimeField);


Ext.ux.form.STimeField = Ext.extend(Ext.ux.form.FieldPanel, {
	border: false,
	baseCls: null,
	layout: 'table',
	token: ':',
	layoutConfig: {
		columns: 5
	},
	width: 180,
	// private

	initComponent: function(){

				var store = new Ext.data.SimpleStore({
				fields: ['value'],
				data : [['0'],['1'],['2'],['3'],['4'],['5'],['6'],['7'],['8'],['9'],['10'],['11'],['12'],['13'],['14'],['15'],['16'],['17'],['18'],['19'],['20'],['21'],['22'],['23']]
				});

				var combo = new Ext.form.ComboBox({
				store: store,
				displayField:'value',
                hideLabel:true,
				hiddenName: this.name + '0',
				triggerAction: 'all',
				width:50,
				mode: 'local',
					validator:function(value){
						var b = /^[0-9]$/.test(value);
						var c = /^1[0-9]$/.test(value);
						var d = /^2[0-3]$/.test(value);
						if(!b & !c & !d){
							Ext.Msg.alert("系统提示", "请输入正确时间");
							return "请输入正确小时";
						}
						return true;
				    }
		        });
		        
		        var store1 = new Ext.data.SimpleStore({
				fields: ['value'],
				data : [['0'],['1'],['2'],['3'],['4'],['5'],['6'],['7'],['8'],['9'],['10'],['11'],['12'],['13'],['14'],['15'],['16'],['17'],['18'],['19'],['20'],
				['21'],['22'],['23'],['24'],['25'],['26'],['27'],['28'],['29'],['30'],['31'],['32'],['33'],['34'],['35'],['36'],['37'],['38'],['39'],['40'],
				['41'],['42'],['43'],['44'],['45'],['46'],['47'],['48'],['49'],['50'],['51'],['52'],['53'],['54'],['55'],['56'],['57'],['58'],['59']]
				});

				var combo1 = new Ext.form.ComboBox({
				store: store1,
				displayField:'value',
                hideLabel:true,
				hiddenName: this.name + '1',
				triggerAction: 'all',
				width:50,
				mode: 'local',
					validator:function(value){
						var b = /^[0-9]$/.test(value);
						var c = /^[1-5][0-9]$/.test(value);
						if(!b & !c){
							Ext.Msg.alert("系统提示", "请输入正确时间");
							return "请输入正确分钟";
						}
						return true;
					}
		        });
		        
		        var store2 = new Ext.data.SimpleStore({
				fields: ['value'],
				data : [['0'],['1'],['2'],['3'],['4'],['5'],['6'],['7'],['8'],['9'],['10'],['11'],['12'],['13'],['14'],['15'],['16'],['17'],['18'],['19'],['20'],
				['21'],['22'],['23'],['24'],['25'],['26'],['27'],['28'],['29'],['30'],['31'],['32'],['33'],['34'],['35'],['36'],['37'],['38'],['39'],['40'],
				['41'],['42'],['43'],['44'],['45'],['46'],['47'],['48'],['49'],['50'],['51'],['52'],['53'],['54'],['55'],['56'],['57'],['58'],['59']]
				});

				var combo2 = new Ext.form.ComboBox({
				store: store2,
				displayField:'value',
                hideLabel:true,
				hiddenName: this.name + '2',
				triggerAction: 'all',
				width:50,
				mode: 'local',
					validator:function(value){
						var b = /^[0-9]$/.test(value);
						var c = /^[1-5][0-9]$/.test(value);
						if(!b & !c){
							Ext.Msg.alert("系统提示", "请输入正确时间");
							return "请输入正确分钟";
						}
						return true;
					}
		        });
		this.items = [combo, {
			html: ':',
			baseCls: null,
			bodyStyle: 'font-weight: bold; font-size-adjust: .9',
			border: false
		},combo1,{
			html: ':',
			baseCls: null,
			bodyStyle: 'font-weight: bold; font-size-adjust: .9',
			border: false
		},combo2 ]
		Ext.ux.form.STimeField.superclass.initComponent.call(this);
	}
});
Ext.reg('stimefield', Ext.ux.form.STimeField);
